//
//  JSMStrategyElementsModel.m
//  TakeYouTourTogether
//
//  Created by king on 15/12/5.
//  Copyright © 2015年 king. All rights reserved.
//

#import "JSMStrategyElementsModel.h"
#import "JSMStrategyModel.h"

@implementation JSMStrategyElementsModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"data"]) {
        self.dataArray = [JSMStrategyModel baseModelByArr:value];
        NSLog(@"%@", self.dataArray);
    }
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:self.dataArray forKey:@"dataArray"];
    [aCoder encodeObject:self.title forKey:@"title"];
    [aCoder encodeBool:self.more forKey:@"more"];
    [aCoder encodeInteger:self.index forKey:@"index"];
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self) {
        self.dataArray = [aDecoder decodeObjectForKey:@"dataArray"];
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.more = [aDecoder decodeBoolForKey:@"more"];
        self.index = [aDecoder decodeIntegerForKey:@"index"];
    }
    return self;
}

@end
